package com.bo.book.enums;

public enum BookStatus {
    DELETED(0,"无效"),
    NORMAL(1,"可借阅"),
    FORBIDDEN(2,"不可借阅");

    private int code;
    private String desc;

    BookStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }
    public static String getStatusByCode(int code){
        if(code == 0){
            return DELETED.desc;
        }else if(code == 1){
            return NORMAL.desc;
        }else if(code == 2){
            return FORBIDDEN.desc;
        }
        return null;
    }
}
